package com.novice.feignService;

import com.novice.domain.pojo.User;
import com.novice.feignService.fallback.UserServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "userservice", fallback = UserServiceFallback.class)
public interface IUserServiceFeign {
    // 默认都是@RequestBody
    /**
     * 根据id查询用户
     * @param id id
     * @return User
     */
    @GetMapping("/api/user/{userId}") // 必须和服务提供者中的接口地址一致
    User getUserById(@PathVariable("userId") Long id);
}
